import request from '@/utils/request'
import { SET_CHANNELS } from '@/store/actionTypes'
export const getChannels = () => {
    return  async dispatch => {
        // 发异步请求
        const res = await request({url: '/channels'})
        console.log('频道数据', res)
        dispatch({
            type: SET_CHANNELS,
            payload: res.data.channels
        })
    }
}